/*
** File name:		gkt_crypto.h
** Brief: 
** COPYRIGHT(C) gkt 2019 
** ------------------------------------------------------- 
** Module Information: 
** 
** Revision History -------------------------------------- 
** ------------------------------------------------------- 
**	Date 		Version		Action				Author   
** ------------------------------------------------------- 
**	2019-5-8 	1.0			Created				liwenjie   
** 
*/ 

#include "gkt_types.h"

#ifndef GKT_CRYPTO_H
#define GKT_CRYPTO_H

#ifdef __cplusplus
extern "C" {
#endif

/* crypto mode */
typedef enum _gkt_crypto_mode {
	GKT_CRYPTO_MODE_ECB = 0,	/* Electronic Codebook Book */
	GKT_CRYPTO_MODE_CBC,	/* Cipher Block Chaining */
	GKT_CRYPTO_MODE_CTR,	/* Counter */
	GKT_CRYPTO_MODE_CFB,	/* Cipher FeedBack */
	GKT_CRYPTO_MODE_OFB,	/* Output FeedBack */
	GKT_CRYPTO_MODE_MAX
} gkt_crypto_mode_e;

/* encrypto padding mode */
typedef enum {
	GKT_CRYPTO_PADDING_ZERO = 0,
	GKT_CRYPTO_PADDING_PKCS7,
	GKT_CRYPTO_PADDING_MAX
} gkt_crypto_padding_e;

typedef struct _gkt_crypto_padding_params {
	gkt_crypto_padding_e	mode;
	uint32_t	block_size;

	uint8_t	*message_buff;
	uint32_t	message_actual_size;
	uint32_t	message_max_size;

	uint8_t	*message_padded_buff;
	uint32_t	message_padded_size;
} gkt_crypto_padding_params_s;

#include "gkt_crypto_aes.h"
#include "gkt_crypto_des.h"
#include "gkt_crypto_sha.h"

/* Functions ----------------------------------------------------*/
void gkt_crypto_irq_handler(void);
int gkt_crypto_init(void);


#ifdef __cplusplus
}
#endif

#endif	/* GKT_CRYPTO_H */

